<template>
  <!-- 列表区域 -->
  <section class="main">
    <ul class="todo-list">
      <li class="todo" v-for="(item,index) in list" :key="item.id">
        <div class="view">
          <span class="index">{{ index+1 }}.</span>
          <label>{{ item.msg }}</label>
          <button class="destroy" @click="del(item.id)"></button>
        </div>
      </li>
    </ul>
  </section>
</template>

<script>
export default {
  data(){
    return{
      id:''
    }
  },
  // 父传子 props
  props:{
    list:Array
  },
  methods:{
    del(id){
      // console.log(id);
      this.$emit('delId',id)
    }
  }
}
</script>

<style>
</style>